/**    
* @Title: ConfPropertyPlaceholderConfigurer.java  
* @Package com.kaver.spring   
* @author roc   
* @date 2019年1月30日 下午5:04:58  
* @version V1.0  
* @copyright kaver 
*/
package com.kaver.spring;

import java.io.IOException;
import java.util.Properties;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;

/**
 * @ClassName: ConfPropertyPlaceholderConfigurer
 * @Description: 重写 PropertyPlaceholderConfigurer
 * @author roc
 * @date 2019年1月30日 下午5:04:58
 * 
 */
public class ConfPropertyPlaceholderConfigurer extends PropertyPlaceholderConfigurer {

	@Override
	protected void processProperties(ConfigurableListableBeanFactory beanFactoryToProcess, Properties props)
			throws BeansException {
		super.processProperties(beanFactoryToProcess, props);
	}

	@Override
	protected Properties mergeProperties() throws IOException {
		Properties properties = super.mergeProperties();
		AppInstance.initAppInstance(properties);
		AppInstance.loadLocalAndRomoteProperties();
		AppInstance.merge(properties);
		return properties;
	}
}
